package com.caiyue.wyymusic.service.impl;

import com.caiyue.wyymusic.domain.result.ResponseData;
import com.caiyue.wyymusic.domain.result.ResponseMsg;
import com.caiyue.wyymusic.mapper.MCategoryMapper;
import com.caiyue.wyymusic.pojo.MCategory;
import com.caiyue.wyymusic.service.MCategoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 日期:2018/7/13
 * 作者:yangt
 * 描述:
 */
@Service
public class MCategoryServiceImpl implements MCategoryService {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private MCategoryMapper mCategoryMapper;

    @Override
    public ResponseData queryAllMCategory() {
        try {
            List<MCategory> mCategories = mCategoryMapper.selectAllMCategory();
            logger.info("======================查询音乐类目列表结果为===================" + mCategories);
            return new ResponseData(ResponseMsg.SUCCESS, mCategories);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("=====================查询音乐类目列表失败===================" + e.getMessage());
            return new ResponseData(ResponseMsg.FAILED);
        }
    }
}
